package com.jy.wms.service;

import com.jy.wms.common.annotions.BaseServiceDescribe;
import com.jy.wms.common.base.BaseService;
import com.jy.wms.common.base.ServiceException;
import com.jy.wms.pojo.WmsQcEnclosure;
import com.jy.wms.dao.WmsQcEnclosureMapper;
import org.springframework.stereotype.Service;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import java.util.List;

    /**
    * @ClassName: WmsQcEnclosureService.java
    * @Description: TODO(这里用一句话描述这个类的作用)
    * @Author Jane
    * @Date Tue Dec 19 18:06:20 CST 2017
    */

    @Service
    public class WmsQcEnclosureService extends BaseService<WmsQcEnclosureMapper,WmsQcEnclosure> {

     /**
     * 插入一条记录
     * @param entity 实体对象
     * @return int
     */
     @BaseServiceDescribe(moduleName = "关于质检单附件操作",btnName = "新增质检单附件")
    public void baseInsert( WmsQcEnclosure entity) throws ServiceException{
        int count =dao.baseInsert( entity );
        if(count<=0){
            throw new ServiceException("新增质检单附件失败");
        }
    }

   /**
    * 插入一条记录（匹配有值的字段）
    * @param entity 实体对象
    * @return int
    */
    public Integer baseInsertSelective( WmsQcEnclosure entity){
         return dao.baseInsertSelective( entity);
    }

   /**
    * 删除（根据主键ID删除）
    * @param id 主键
    * @return int
    */
    public Integer baseDeleteByPrimaryKey( String id){
         return dao.baseDeleteByPrimaryKey( id);
    }

   /**
    * 删除（根据ID 批量删除）
    * @param idList 主键ID列表
    * @return int
    */
   @BaseServiceDescribe(moduleName = "关于质检单附件操作",btnName = "批量删除质检单附件")
    public Integer baseDeleteBathPrimaryKeys( List<String> idList){
         return dao.baseDeleteBathPrimaryKeys( idList );
    }

    /**
    * 分页查询
    * @param sszjdid 所属质检单Id
    * @return Page<WmsQcEnclosure>
    */
    @BaseServiceDescribe(moduleName = "关于质检单附件操作",btnName = "查询质检单附件")
    public List<WmsQcEnclosure> baseSelectPage(String sszjdid){
        return dao.baseSelectPage(sszjdid);
    }

   /**
    * 查询（根据主键ID查询）
    * @param id 主键ID
    * @return WmsQcEnclosure
    */
    public WmsQcEnclosure baseSelectByPrimaryKey( String id ){
         return dao.baseSelectByPrimaryKey( id );
    }

   /**
    * 查询（根据ID 批量查询）
    * @param idList 主键ID列表
    * @return list
    */
    public Integer baseSelectBathPrimaryKeys( List<WmsQcEnclosure> idList ){
         return dao.baseSelectBathPrimaryKeys( idList );
    }

   /**
    *修改 （匹配有值的字段）
    * @param entity 主键ID列表
    * @return int
    */
    public void baseUpdateByPrimaryKeySelective( WmsQcEnclosure entity)throws ServiceException{
        int count=dao.baseUpdateByPrimaryKeySelective(entity);
        if(count<=0){
            throw new ServiceException("编辑质检单附件失败");
        }
    }

   /**
    *修改（根据主键ID修改）
    * @param entity 主键ID列表
    * @return int
    */
    public Integer baseUpdateByPrimaryKey( WmsQcEnclosure entity){
         return dao.baseUpdateByPrimaryKey( entity);
    }
}
